import request from "@/utils/request";

//列映射

//映射列表
export function getColMappingList() {
  return request({
    url: "/plat/config/mapping/list",
    method: "get"
  });
}

//AD column 列表
export function getAdMColumnist() {
  return request({
    url: "/plat/config/mapping/ad/list",
    method: "get"
  });
}

//接口 column 列表
export const getInterfaceMColumnListRequest = () => {
  return request({
    url: "/plat/config/mapping/interface/list",
    method: "get"
  });
};

//修改 column 映射
export function updateMapping(data) {
  return request({
    url: "/plat/config/mapping/edit",
    method: "post",
    data
  });
}

//修改 column 映射
export const saveMapping = data => {
  return request({
    url: "/plat/config/mapping/save",
    method: "post",
    data
  });
};

//删除column映射
export const deleteMapping = colName => {
  return request({
    url: `/plat/config/mapping/delete/${colName}`,
    method: "delete"
  });
};
export default {
  getInterfaceMColumnListRequest,
  saveMapping,
  deleteMapping
};
